﻿Imports BUS
Imports DTO

Public Class frmxlcapnhatbangcap
    Private _maBangCap As Integer
    Public Property MaBangCap() As Integer
        Get
            Return _maBangCap
        End Get
        Set(ByVal value As Integer)
            _maBangCap = value
        End Set
    End Property
    Private _tenBangCap As String
    Public Property TenBangCap() As String
        Get
            Return _tenBangCap
        End Get
        Set(ByVal value As String)
            _tenBangCap = value
        End Set
    End Property

    Private Sub btnchapnhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchapnhan.Click
        If txtbangcap.Text <> "" Then
            Dim sql As String = "Update BANGCAP Set TenBangCap=" + "'" + txtbangcap.Text + "'" + " Where MaBangCap=" + _maBangCap.ToString()
            Dim bus As New BangCapBUS()
            Dim kq As Integer = bus.CapNhatBangCap(sql)
            If kq = 1 Then
                MessageBox.Show("Câp nhật thành công !")
                Me.Close()
            Else
                MessageBox.Show("Cập nhật thất bại !")
            End If
        Else
            MessageBox.Show("Nhập tên bằng cấp !")
        End If
    End Sub

    Private Sub btnthoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthoat.Click
        Me.Close()
    End Sub
End Class